from data_type import *
from scanproject import *

def scansc(time:0,dport:0,pdst:0,sport:0,psrc:0):
    Ethernet = EthernetPkt()
    Ipv4 = Ipv4Pkt()
    Ipv6 = Ipv6Pkt()
    Tcp = TcpPkt()
    Udp = UdpPkt()
    Arp = ArpPkt()
    Dns = DnsPkt()
    Icmpv4 = Icmpv4Pkt()
    Icmpv6 = Icmpv6Pkt()
    HttpReq = HttpReqPkt()
    HttpRes = HttpResPkt()
    a=Packet(Ethernet, Ipv4, Ipv6, Tcp, Udp, Arp, Dns, Icmpv4, Icmpv6, HttpReq, HttpRes)
    a.flag['ipv4']=1
    a.flag['ethernet']=1
    a.flag['tcp']=1
    Ethernet.time=time
    Ipv4.srcIp = psrc    #源IP地址
    Ipv4.dstIp = pdst    #目的IP地址
    Tcp.sport=sport
    Tcp.dport=dport
    return a
a=[scansc(5, 2, '0.0.0.1',80, '0.0.0.2'),
    scansc(6, 2, '0.0.0.1',80, '0.0.0.2'),
    scansc(7, 2, '0.0.0.1',80, '0.0.0.2'),
    scansc(8, 3, '0.0.0.1',80, '0.0.0.2')
    ]
print(port_scan(a,2,2,[]))

#arpcheat_check(a)